package com.adv.util;

import java.text.SimpleDateFormat;

public final class Constant {
	// 登录时记住我
	public static final String REMEMBERENABLE = "1";
	// "kaptcha" 来自web.xml中的验证码生成类参数
	public static final String KAPTCHA = "kaptcha";

	// 返回json状态数据的key
	public static final String RESULTKEY = "code";
	// 返回json消息数据的key
	public static final String RESULTMSG = "msg";
	// 操作成功
	public static final String SUCCESS = "1";
	// 操作失败，原因未知
	public static final String FAILURE = "2";
	// 记录已存在
	public static final String RECORDEXISTS = "11";
	// 记录不存在
	public static final String RECORDNOTEXISTS = "12";
	// 字段校验错误
	public static final String FIELDINVALID = "21";
	// 有关联资源存在，无法删除
	public static final String HASRELATEDRESOURCE = "51";
	// 无法获取上传的文件
	public static final String UPLOAD_NO_FILE = "100";

	// 上传的文件资源在session中的key
	public static final String UPLOADSOURCEKEY = "upload_key_session";

	public static final SimpleDateFormat SDFCOMMON = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");

	public enum MessageType {
		COMMON((short) 1, "常用消息");

		private Short code;
		private String desc;

		public Short getCode() {
			return code;
		}

		public void setCode(Short code) {
			this.code = code;
		}

		public String getDesc() {
			return desc;
		}

		public void setDesc(String desc) {
			this.desc = desc;
		}

		MessageType(Short code, String desc) {
			this.code = code;
			this.desc = desc;
		}
	}

	public enum AdverposType {
		ADVERTISER((short) 1, "广告商"), PRODUCT((short) 2, "产品"), LOGO((short) 3, "Logo");

		private Short code;
		private String desc;

		public Short getCode() {
			return code;
		}

		public void setCode(Short code) {
			this.code = code;
		}

		public String getDesc() {
			return desc;
		}

		public void setDesc(String desc) {
			this.desc = desc;
		}

		AdverposType(Short code, String desc) {
			this.code = code;
			this.desc = desc;
		}
	}

	public enum BusinessType {
		ADVERT((short) 1, "广告图片"), LOGO((short) 2, "logo");

		private Short code;
		private String desc;

		public Short getCode() {
			return code;
		}

		public void setCode(Short code) {
			this.code = code;
		}

		public String getDesc() {
			return desc;
		}

		public void setDesc(String desc) {
			this.desc = desc;
		}

		BusinessType(Short code, String desc) {
			this.code = code;
			this.desc = desc;
		}
	}

	public enum ImageType {
		ICON((short) 1, "图标"), BIGIMAGE((short) 2, "大图");

		private Short code;
		private String desc;

		public Short getCode() {
			return code;
		}

		public void setCode(Short code) {
			this.code = code;
		}

		public String getDesc() {
			return desc;
		}

		public void setDesc(String desc) {
			this.desc = desc;
		}

		ImageType(Short code, String desc) {
			this.code = code;
			this.desc = desc;
		}
	}
}
